import { Controller, Get } from '@nestjs/common';
import { MessageService } from './message.service';
import { responseMessage } from 'src/common/responseMessage';

@Controller('message')
export class MessageController {
  constructor(private messageService: MessageService) {}

  /**
   *
   * @returns 获取消息列表
   */
  @Get('list')
  async getMessageList() {
    const result = await this.messageService.getMessageList();
    return responseMessage(result);
  }
  // @Post('send')
  // async insertMessage(@Body() messageInfo: CreateMessageDto) {
  //   const data: InsertMessageDto = {
  //     creater: messageInfo.sendUser,
  //     ...messageInfo,
  //   };
  //   await this.messageService.insertMessage(data);
  //   return responseMessage(true, '发送成功');
  // }
}
